/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package EntityBeans;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Keith Augustsson
 */
@Entity
@Table(name = "passengers")
@NamedQueries({@NamedQuery(name = "Passengers.findAll", query = "SELECT p FROM Passengers p"), @NamedQuery(name = "Passengers.findByPNr", query = "SELECT p FROM Passengers p WHERE p.pNr = :pNr"), @NamedQuery(name = "Passengers.findByName", query = "SELECT p FROM Passengers p WHERE p.name = :name"), @NamedQuery(name = "Passengers.findBySeatNr", query = "SELECT p FROM Passengers p WHERE p.seatNr = :seatNr"), @NamedQuery(name = "Passengers.findBySeatRow", query = "SELECT p FROM Passengers p WHERE p.seatRow = :seatRow")})
public class Passengers implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "pNr")
    private String pNr;
    @Basic(optional = false)
    @Column(name = "name")
    private String name;
    @Column(name = "seatNr")
    private Integer seatNr;
    @Column(name = "seatRow")
    private Integer seatRow;

    public Passengers() {
    }

    public Passengers(String pNr) {
        this.pNr = pNr;
    }

    public Passengers(String pNr, String name) {
        this.pNr = pNr;
        this.name = name;
    }

    public String getPNr() {
        return pNr;
    }

    public void setPNr(String pNr) {
        this.pNr = pNr;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getSeatNr() {
        return seatNr;
    }

    public void setSeatNr(Integer seatNr) {
        this.seatNr = seatNr;
    }

    public Integer getSeatRow() {
        return seatRow;
    }

    public void setSeatRow(Integer seatRow) {
        this.seatRow = seatRow;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pNr != null ? pNr.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Passengers)) {
            return false;
        }
        Passengers other = (Passengers) object;
        if ((this.pNr == null && other.pNr != null) || (this.pNr != null && !this.pNr.equals(other.pNr))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "EntityBeans.Passengers[pNr=" + pNr + "]";
    }

}
